<template>
  <el-tabs v-model="activeName">
    <!-- <el-tab-pane label="编辑模式" name="edit">
      <EditMode />
    </el-tab-pane> -->
    <el-tab-pane label="源码模式" name="code">
      <CodeMode />
    </el-tab-pane>
    <el-tab-pane lazy label="预览模式" name="preview">
      <PreviewMode />
    </el-tab-pane>
  </el-tabs>
</template>

<script setup>
import { ref, provide, onMounted } from 'vue'
// import EditMode from './mode/edit/index.vue'
import CodeMode from './mode/code.vue'
import PreviewMode from './mode/preview.vue'
import { useRoute, useRouter } from 'vue-router';
import request from '@/utils/axios'

const route = useRoute()
const router = useRouter()

const config = ref()

const activeName = ref('code')

provide('config', {
  config,
  updateConfig
})

function updateConfig(value) {
  config.value = value
}

function getDetail () {
  request({
    url: ''
  })
}

onMounted(() => {
  if (route.query.pageId) {
    getDetail();
  }
})
</script>
